// 获取cookie
var username = tool.getCookie('username');
if (username) {
    $('.logininfo').html(
        `
        <a>欢迎<span style="font-size:18px;color:#ff0036;">&nbsp;${username}</span></a>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <a class="logout">退出</a>
        `
    )
    $('.logout').click(function () {
        var loadindex = layer.confirm('您确定要退出吗', {
                btn: ['确定', '在看看'] //按钮
            }, function () {
                tool.removeCookie('username');
                $('.logininfo').html(
                    `
                        <a href="./page/signin.html" target="-blank">请登录</a>
                        <a href="./page/signup.html" target="_blank">免费注册</a>
                    `
                )
                layer.close(loadindex);


            },
            function () {
                layer.msg('那您再看看', {
                    time: 1000, //20s后自动关闭
                });
            });

    })
}